-- 1. Use a fold (choosing the appropriate fold will make your code much simpler) to
-- rewrite and improve upon the asInt function from the earlier section“Explicit Recursion” on page 85.

import Data.Char

asInt_fold :: String -> Int    
asInt_fold xs = foldl step 0 xs
           where step acc x = acc * 10 + digitToInt x 
